<?xml version="1.0" encoding="utf-8"?>




<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">




<xsl:template match="/">
<html>
<head>
<title>Log File for Humm and Strumm</title>
</head>


<body>

<xsl:apply-templates select="log/header" />
<hr />

<p>Details of selected log entries:</p>
<table border="1"
       width="100%"
       cellspacing="0"
       cellpadding="0"
       bordercolorlight="#000000"
       bordercolordark="#ffffff"
       bordercolor="#000000"
       style="font-family: monospace;">
<tr bgcolor="#000000">
<td width="3%"><center><b style="color: #ffffff;">#</b></center></td>
<td width="20%"><center><b style="color: #ffffff;">Time</b></center></td>
<td width="23%"><center><b style="color: #ffffff;">File</b></center></td>
<td width="50%"><center><b style="color: #ffffff;">Function</b></center></td>
<td width="4%"><center><b style="color: #ffffff;">Line</b></center></td>
</tr>
<xsl:apply-templates select="log/event" />
</table>

</body>
</html>
</xsl:template>





<xsl:template match="header">
<div id="header">
<h2>Log File Information</h2>


<p>Output level: <i style="color: #808080;"><xsl:value-of select="level" /></i><br />


Run started at <i style="color: #808080;"><xsl:value-of select="timestamp/@time" /></i> on <i style="color: #808080;"><xsl:value-of select="timestamp/@date" /></i><br />


Operating System: <i style="color: #808080;"><xsl:value-of select="system/platform" /></i><br />


System Processors:<br />
<xsl:for-each select="system/processors/processors">
<i style="color: #808080; padding-left: 3%;"><xsl:value-of select="." /></i><br />
</xsl:for-each>


Total RAM: <i style="color: #808080;"><xsl:value-of select="system/memory" /></i></p>
</div>
</xsl:template>




<xsl:template match="event">
<xsl:choose>



<xsl:when test="level='message'">
<tr bgcolor="#80ff80" valign="middle" align="center">

<xsl:apply-templates select="id" />
<xsl:apply-templates select="timestamp" />
<xsl:apply-templates select="file" />
<xsl:apply-templates select="function" />
<xsl:apply-templates select="line" />

</tr>

<tr bgcolor="#aaffaa">
<xsl:apply-templates select="message" />
</tr>
</xsl:when>



<xsl:when test="level='information'">
<tr bgcolor="#" valign="middle" align="center">

<xsl:apply-templates select="id" />
<xsl:apply-templates select="timestamp" />
<xsl:apply-templates select="file" />
<xsl:apply-templates select="function" />
<xsl:apply-templates select="line" />

</tr>

<tr bgcolor="#000000">
<xsl:apply-templates select="message" />
</tr>
</xsl:when>





<xsl:when test="level='success'">
<tr bgcolor="#8080ff" valign="middle" align="center">

<xsl:apply-templates select="id" />
<xsl:apply-templates select="timestamp" />
<xsl:apply-templates select="file" />
<xsl:apply-templates select="function" />
<xsl:apply-templates select="line" />

</tr>

<tr bgcolor="#aaaaff">
<xsl:apply-templates select="message" />
</tr>
</xsl:when>




<xsl:when test="level='warning'">
<tr bgcolor="#ffaa80" valign="middle" align="center">

<xsl:apply-templates select="id" />
<xsl:apply-templates select="timestamp" />
<xsl:apply-templates select="file" />
<xsl:apply-templates select="function" />
<xsl:apply-templates select="line" />

</tr>

<tr bgcolor="#ffddaa">
<xsl:apply-templates select="message" />
</tr>
</xsl:when>




<xsl:when test="level='error'">
<tr bgcolor="#ff8080" valign="middle" align="center">

<xsl:apply-templates select="id" />
<xsl:apply-templates select="timestamp" />
<xsl:apply-templates select="file" />
<xsl:apply-templates select="function" />
<xsl:apply-templates select="line" />

</tr>

<tr bgcolor="#ffaaaa">
<xsl:apply-templates select="message" />
</tr>
</xsl:when>

</xsl:choose>
</xsl:template>



<xsl:template match="id">
<td>
<b><xsl:value-of select="." /></b>
</td>
</xsl:template>
<xsl:template match="timestamp">
<td>
<xsl:value-of select="@date" /> at <xsl:value-of select="@time" />
</td>
</xsl:template>
<xsl:template match="file">
<td>
<xsl:value-of select="." />
</td>
</xsl:template>
<xsl:template match="function">
<td>
<xsl:value-of select="." />
</td>
</xsl:template>
<xsl:template match="line">
<td>
<xsl:value-of select="." />
</td>
</xsl:template>
<xsl:template match="message">
<td bgcolor="#ffffff" />
<td colspan="4"><b>
<xsl:value-of select="." />
</b></td>
</xsl:template>


</xsl:stylesheet>
